home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Communications / Converse / Source / UnixInfo.txt < prev    next >
Text File  |  1995-10-18  |  5KB  |  166 lines

  1. Unix information relevant to Converse.
  2. Used to get the User Information.
  3. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  4. GETUID(2)           UNIX Programmer's Manual            GETUID(2)
  5.  
  6. NAME
  7.      getuid, geteuid - get user identity
  8.  
  9. SYNOPSIS
  10.      #include <sys/types.h>
  11.  
  12.      uid_t getuid(void);
  13.  
  14.      uid_t geteuid(void);
  15.  
  16. DESCRIPTION
  17.      Getuid returns the real user ID of the current process,
  18.      geteuid the effective user ID.
  19.  
  20.      The real user ID identifies the person who is logged in.
  21.      The effective user ID gives the process additional permis-
  22.      sions during execution of "set-user-ID" mode processes,
  23.      which use getuid to determine the real-user-id of the pro-
  24.      cess that invoked them.
  25. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  26. GETPWUID(3)         UNIX Programmer's Manual          GETPWUID(3)
  27.  
  28. NAME
  29.      getpwuid, getpwnam, getpwent, setpwent, endpwent, setpwfile
  30.      - user database access
  31.  
  32. SYNOPSIS
  33.      #include <sys/types.h>
  34.      #include <pwd.h>
  35.  
  36.      struct passwd *getpwuid(uid_t uid)
  37.  
  38.      struct passwd *getpwnam(const char *name)
  39.  
  40. (ALSO AVAILABLE IN BSD)
  41.      struct passwd *getpwent(void);
  42.  
  43.      void setpwent(void);
  44.  
  45.      void endpwent(void);
  46.  
  47.      void setpwfile(char *name);
  48.  
  49. DESCRIPTION
  50.      The getpwuid and getpwnam functions both return a pointer to
  51.      a passwd structure containing an entry from the system's
  52.      user (password) database with a matching numeric user ID
  53.      (uid) or a user login name (name).
  54.  
  55.      The passwd structure is defined in the header <pwd.h> and
  56.      includes the following members:
  57.  
  58.           struct    passwd { /* see getpwent(3) */
  59.                char *pw_name;        /* name (login name, contains no upper case) */
  60.                char *pw_passwd;        /* encrypted password */
  61.                int  pw_uid;            /* numerical user ID */
  62.                int  pw_gid;            /* numerical group ID */
  63.                int  pw_quota;        /* unused */
  64.                char *pw_comment;    /* unused */
  65.                char *pw_gecos;        /* user's real name, office, extension, home phone */
  66.                char *pw_dir;        /* initial working directory */
  67.                char *pw_shell;        /* program to use as Shell */
  68.           };
  69.  
  70.  
  71.           Member Type    Member Name         Description
  72.  
  73.           char *         pw_name             Login name.
  74.  
  75.           uid_t          pw_uid              Numerical user ID.
  76.  
  77.           gid_t          pw_gid              Numerical group ID.
  78.  
  79.           char *         pw_dir              Pathname of home
  80.                                              directory.
  81.  
  82.           char *         pw_shell            Initial user (shell)
  83.                                              program.
  84.  
  85.           char *         pw_passwd           User password. (BSD
  86.                                              only; not POSIX-
  87.                                              compliant)
  88.  
  89.      The passwd structure may contain more implementation-
  90.      specific members than those listed here;see passwd(5) for
  91.      more information.
  92.  
  93.      The BSD routines setpwent, getpwent, endpwent, and setpwfile
  94.      may be used to scan the user database sequentially.
  95.      setpwent resets the current user password structure to the
  96.      first in the database, getpwent reads and returns the next
  97.      user password entry, and endpwent closes the user password
  98.      database when processing is complete.  In addition,
  99.      setpwfile may be called to set the database to that given in
  100.      file name, which is a file in passwd(5) format.  Setpwfile
  101.      doesn't close the previous password file; endpwent should be
  102.      used before setpwfile.
  103.  
  104. NOTES
  105.      The value returned points to a static area; if the informa-
  106.      tion is to be saved, it must be copied.
  107.  
  108. RETURN VALUE
  109.      A NULL pointer is returned on error or if the requested
  110.      entry is not found.
  111.  
  112. FILES
  113.      /etc/passwd - if NetInfo is not running, or if YellowPages
  114.      is enabled.
  115.  
  116. SEE ALSO
  117.      getlogin(3), getgrent(3), lookupd(8), netinfo(5), passwd(5)
  118. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  119. GETHOSTNAME(2)      UNIX Programmer's Manual       GETHOSTNAME(2)
  120.  
  121. NAME
  122.      gethostname, sethostname - get/set name of current host
  123.  
  124. SYNOPSIS
  125.      gethostname(name, namelen)
  126.      char *name;
  127.      int namelen;
  128.  
  129.      sethostname(name, namelen)
  130.      char *name;
  131.      int namelen;
  132.  
  133. DESCRIPTION
  134.      Gethostname returns the standard host name for the current
  135.      processor, as previously set by sethostname.  The parameter
  136.      namelen specifies the size of the name array.  The returned
  137.      name is null-terminated unless insufficient space is pro-
  138.      vided.
  139.  
  140.      Sethostname sets the name of the host machine to be name,
  141.      which has length namelen.     This call is restricted to the
  142.      super-user and is normally used only when the system is
  143.      bootstrapped.
  144.  
  145. RETURN VALUE
  146.      If the call succeeds a value of 0 is returned.  If the call
  147.      fails, then a value of -1 is returned and an error code is
  148.      placed in the global location errno.
  149.  
  150. ERRORS
  151.      The following errors may be returned by these calls:
  152.  
  153.      [EFAULT]       The name or namelen parameter gave an invalid
  154.                     address.
  155.  
  156.      [EPERM]        The caller tried to set the hostname and was
  157.                     not the super-user.
  158.  
  159. SEE ALSO
  160.      gethostid(2)
  161.  
  162. BUGS
  163.      Host names are limited to MAXHOSTNAMELEN (from
  164.      <sys/param.h>) characters, currently 256.
  165. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  166.